package com.example.carrierapp.net

import com.example.carrierapp.bean.goodssource.BidRequestBody
import com.example.carrierapp.bean.person.ModifyPassRequestBody
import com.example.carrierapp.bean.person.ModifyPhoneRequestBody
import com.example.carrierapp.bean.person.PassNextStepRequestBody
import com.example.carrierapp.bean.person.PhoneCodeRequestBody
import com.google.gson.JsonObject

import io.reactivex.Flowable
import okhttp3.MultipartBody
import retrofit2.http.Body
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part

interface ApiStrores {

    //获取省市区
    @get:POST("api/services/app/addressBase/GetAllAndroid")
    val provinceCity: Flowable<JsonObject>

    /**
     * 个人中心
     */
    @get:POST("/api/admin/V1/CarrierApp/AppGetCarrierInfo")
    val userInfo: Flowable<JsonObject>

    /**
     * 登录
     */
    @POST("/api/admin/V1/CarrierApp/LoginAsync")
    fun login(@Body parras: Map<String, String>): Flowable<JsonObject>


    /**
     * 搜索条件
     */
    @POST("/api/admin/V1/car/GetQueryList")
    fun searchFilter(@Body parras: Map<String, String>): Flowable<JsonObject>

    //上传图片
    @Multipart
    @POST("api/Upload/Process")
    fun upLoadPic(@Part file: MultipartBody.Part): Flowable<JsonObject>

    /**
     * banner
     */
    @POST("/api/admin/V1/message/GetBanners")
    fun getBanner(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 首页承运信息
     */
    @POST("/api/admin/V1/carrierAppTrans/GetIndex")
    fun getHomeInfo(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 找货列表
     */
    @POST("/api/admin/V1/carrierAppTrans/GetSourceOfGoods")
    fun getFindGoodsList(@Body parras: Map<String, String>): Flowable<JsonObject>


    /**
     * 找货详情
     * post /api/admin/V1/carrierAppTrans/GetSourceOfGoods
     */
    @POST("/api/admin/V1/carrierAppTrans/GetSourceDetailOfGoods")
    fun getFindGoodsDetaill(@Body parras: Map<String, String>): Flowable<JsonObject>


    /**
     * 承运商指派车辆
     */
    @POST("/api/admin/V1/CarrierApp/FuzzySearchCar")
    fun getAllCarPages(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 竞价，抢单详情的提交报价或者抢单 "; AppGrabOrBidding
     */
    @POST("/api/admin/V1/bidding/AppGrabOrBidding")
    fun rabOrBidding(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 中标
     */
    @POST("/api/admin/V1/carrierAppTrans/GetBidding")
    fun tenderList(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 个人通知
     */
    @POST("/api/admin/V1/message/GetPagesApp")
    fun getNoticeList(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 个人通知 詳情
     */
    @POST("/api/admin/V1/message/GetModelById")
    fun getNoticeDetail(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 忘记密码 验证码登录  /api/admin/V1/messageLog/CarrierAppGetMessage
     */
    @POST("/api/admin/V1/messageLog/CarrierAppGetMessage")
    fun sendRetakeMessage(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 再次調度 /api/admin/V1/waybill/AppReScheduling
     */
    @POST("/api/admin/V1/waybill/AppReScheduling")
    fun dispatchAgain(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 修改調度 /api/admin/V1/waybill/AppReScheduling
     */
    @POST("/api/admin/V1/waybill/AppUpdateScheduling")
    fun dispatchModify(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 检查更新/api/admin/V1/version/GetNewest
     */
    @POST("/api/admin/V1/version/GetNewest")
    fun checkUpdate(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 确认交货
     */
    @POST("/api/admin/V1/CarrierApp/ConfirmDelivery")
    fun sureDelivery(@Body parras: Map<String, String>): Flowable<JsonObject>


    /**
     * 获取货源大厅列表
     */
    @POST("/api/admin/V1/CarrierApp/GetSourceOfGoods")
    fun fetchGoodsSourceList(@Body parras: Map<String, String>): Flowable<JsonObject>


    /**
     * 获取货源大厅竞标记录
     */
    @POST("/api/admin/V1/CarrierApp/GetRobbingRecord")
    fun fetchGoodsRecordList(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 获取货源大厅详情
     */
    @POST("/api/admin/V1/CarrierApp/GetBiddingDetail")
    fun fetchGoodsSourceDetails(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 获取竞抢记录详情
     */
    @POST("/api/admin/V1/CarrierApp/GetRobbingDetail")
    fun fetchGoodsRecordDetails(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 竞价/重新竞价/抢单
     */
    @POST("/api/admin/V1/CarrierApp/GrabBid")
    fun doBid(@Body parras: BidRequestBody): Flowable<JsonObject>

    /**
     * 置顶发货计划
     */
    @POST("/api/admin/V1/CarrierApp/SetTop")
    fun setTop(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 取消置顶发货计划
     */
    @POST("/api/admin/V1/CarrierApp/CancelTop")
    fun cancelTop(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 获取调度列表
     */
    @POST("/api/admin/V1/CarrierApp/GetShipment")
    fun getDispatchList(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 发货明细
     */
    @POST("/api/admin/V1/CarrierApp/GetDispatchDetail")
    fun getDispatchDetails(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 获取调度记录
     */
    @POST("/api/admin/V1/CarrierApp/GetDispatch")
    fun getDispatcHistoryhList(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 车辆查询
     */
    @POST("/api/admin/V1/CarrierApp/FuzzySearchCar")
    fun searchCar(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 司机查询
     */
    @POST("/api/admin/V1/CarrierApp/FuzzySearchDriver")
    fun searchDriver(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 新增调度
     */
    @POST("/api/admin/V1/CarrierApp/CreateDispatch")
    fun addDispatch(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 获取运单列表
     * public int State 2运输中 3已送达
     */
    @POST("/api/admin/V1/CarrierApp/GetWaybill")
    fun getWaybillList(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 获取运单详情
     * public int State 2运输中 3已送达
     */
    @POST("/api/admin/V1/CarrierApp/AppGetWaybillDetail")
    fun getWaybillDetails(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 撤销运单
     */
    @POST("/api/admin/V1/CarrierApp/AppCancelWaybill")
    fun cancelWaybill(@Body parras: Map<String, String>): Flowable<JsonObject>

    /**
     * 修改运单
     */
    @POST("/api/admin/V1/CarrierApp/AppUpdateWaybill")
    fun modifyCarnumOrVolume(@Body parras: Map<String, String>): Flowable<JsonObject>
    /**
     * 获取图形验证码
     */
    @POST("/api/admin/V1/CarrierApp/GetImageCode")
    fun getImgaeCode(): Flowable<JsonObject>

    /**
     * 获取短信验证码
     */
    @POST("/api/admin/V1/CarrierApp/GetPhoneCode")
    fun getMessageCode(@Body parras: PhoneCodeRequestBody): Flowable<JsonObject>
    /**
     * 修改密码
     */
    @POST("/api/admin/V1/CarrierApp/AppChangePassword")
    fun changePass(@Body parras: ModifyPassRequestBody): Flowable<JsonObject>

    /**
     * 修改密码时  点击下一步 校验验证码
    post /api/{area}/{version}/CarrierApp/AppValidatePhoneCode
     */
    @POST("/api/admin/V1/CarrierApp/AppValidatePhoneCode")
    fun passNextStep(@Body parras: PassNextStepRequestBody): Flowable<JsonObject>

    /**
     * 修改号码
     */
    @POST("/api/admin/V1/CarrierApp/AppChangePhone")
    fun changePhone(@Body parras: ModifyPhoneRequestBody): Flowable<JsonObject>
}
